<?php session_start();
ob_start();
?>
<html>
    <head>
        <link rel="stylesheet" type="text/css"
              href="http://fonts.googleapis.com/css?family=Roboto:300|Roboto Condensed|Orbitron:900,700">
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>

        <!-- Dates -->
        <script src="js/jquery.maskedinputs.js" type="text/javascript"></script>

        <!-- Menu -->
        <link href="/menu_source/styles.css" rel="stylesheet" type="text/css">
        <link href="menu_source/styles.css" rel="stylesheet" type="text/css">
        <script src="http://code.jquery.com/jquery-latest.min.js"></script>
        <script type='text/javascript' src='/menu_source/menu_jquery.js'></script>
        <script type='text/javascript' src='menu_source/menu_jquery.js'></script>

        <script src="js/utils.js"></script>
        <script src="js/caja.js"></script>
        <link rel="stylesheet" href="css/style.css">
        <meta charset="UTF-8">
        <title>Hostel Admin</title>
    </head>
    <body>


        <?php
      
        // Locale
//        setlocale(LC_ALL, "es_AR");
//        echo "The time is " . date("h:i:sa");
        // Variables de hoy
        $today = date("d.m.Y");
        $year = date("Y", strtotime($today));
        $month = date("m", strtotime($today));
        $day = date("d", strtotime($today));
        
        


        // Variables de registración
        $insertedRegistracion = -1;

        
        
        if (!isset($_SESSION['ha_usr']) || !isset($_SESSION['ha_rol'])) {
            unset($_SESSION['usr']);
            unset($_SESSION['pswd']);
            header("Location: index.php");
        }
        
        if (isset($_POST['salir'])) {
            unset($_SESSION['ha_rol']);
            unset($_SESSION['ha_usr']);
            header("Location: ./index.php");
            exit();
        }
//include "abmInmoAdmin.php";
        echo '<div class = "header">';
        include 'buttonBar.php';
        echo '</div>';
        echo '<div id="blackViel" style="z-index:-1;opacity:0;position: absolute;top:0px;bottom: 0px;left: 0px; right: 0px; background-color: rgba(0,0,0,0.5);"></div>';

        if (isset($_POST['principal'])) {
            include 'principal.php';
        } elseif (isset($_POST['habitaciones'])) {
            include 'habitaciones.php';
        } elseif (isset($_POST['clientes'])) {
            include 'clientes.php';
        } elseif (isset($_POST['cobros'])) {
            include 'cobros.php';
        } elseif (isset($_POST['pagos'])) {
            include 'pagos.php';
        } elseif (isset($_POST['items'])) {
            include 'items.php';
        } elseif (isset($_POST['abrir'])) {
            $tipoCaja = 'abrir';
            include 'caja.php';
        } elseif (isset($_POST['cerrar'])) {
            $tipoCaja = 'cerrar';
            include 'caja.php';
        } elseif (isset($_POST['almacen'])) {
            include 'almacen.php';
        } elseif ($_SESSION['ha_rol'] == 0) {
            include "principal.php";
        } elseif ($_SESSION['ha_rol'] == 1) {
            include "principal.php";
        }
        ?>
        <input type="hidden" style="position: fixed; visibility: hidden;" value="<?php echo $_SESSION['ha_usr'] ?>" id="userLogged">
    </body>
</html>





